﻿using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace TeaLightV5.Foundation.UX.Interfaces.Models
{
    public class EntityObservableCollection<T, TE, TKey>
        : ObservableCollection<T>
        , IObservableCollection<T>
        where T : IEntityModel<TE, TKey>, new()
         
    {
        public EntityObservableCollection()
        { 
        }

        public EntityObservableCollection(IEnumerable<TE> source)
        {
            // todo
            foreach (var entity in source)
            {
                T model = new T();
                model.SetFrom(entity);
                Add(model);
            }
        }

        //public EntityObservableCollection(IEnumerable<T> source)
        //    : base(source)
        //{            
        //}
    }


  
}
